#ifndef __IOI2C_H__
#define __IOI2C_H__


#include <stdint.h>
#include <stdbool.h>


typedef struct  {
    void (*set_scl)(bool level);
    void (*set_sda)(bool level);
    bool (*get_scl)(void);
    bool (*get_sda)(void);
    void (*sda_dir)(bool level);  //!< optional 
    void (*delay)(void);
}ioi2c_t;


extern bool i2c_readbytes(ioi2c_t *pi2c, uint8_t address, uint8_t *buf, uint16_t len);
extern bool i2c_writebytes(ioi2c_t *pi2c, uint8_t address, uint8_t *buf, uint16_t len);
extern bool i2c_writeoffset(ioi2c_t *pi2c, uint8_t address, uint8_t *buf, uint16_t len);


#endif /* __IOI2C_H__ */
